import 'package:auntserver/app_constants.dart';
import 'package:flutter/cupertino.dart';
/// 用于身份选择 ----数据共享
class ChooseIdentity with ChangeNotifier{
  int status;
  IdentityStatus identityStatus;

  ChooseIdentity(this.status, this.identityStatus);
  void setStatus(int sta){
    status = sta;
    switch(status){
      case 1:
        identityStatus = IdentityStatus.aunt;
        break;
      case 2:
        identityStatus = IdentityStatus.company;
        break;
      case 0:
        identityStatus = IdentityStatus.unselected;
        break;
      default:
        identityStatus = IdentityStatus.unselected;
    }
    notifyListeners();
  }

}

class LoginInfo{
  String phone;
  String password;

  LoginInfo(this.phone, this.password);

  LoginInfo.fromJson(Map<String, dynamic> json) {
    phone = json['phone'];
    password = json['password'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['phone'] = this.phone;
    data['password'] = this.password;
    return data;
  }
}